﻿using Microsoft.Windows.Controls.Ribbon;

namespace Infrastructure.Services
{
    /// <summary>
    /// Ribbon management services
    /// </summary>
    public class RibbonService : IRibbonService
    {
        /// <summary>
        /// Application menu
        /// </summary>
        public RibbonApplicationMenu ApplicationMenu { get; set; }

        /// <summary>
        /// Add a split item menu to the application menu
        /// </summary>
        /// <param name="menu">The menu item used as a parent node for the new menu item</param>
        /// <param name="menuItem">The new menu item</param>
        public void AddSplitMenuItem(RibbonMenu menu, RibbonApplicationSplitMenuItem menuItem)
        {
            switch (menu)
            {
                case RibbonMenu.ExportList:
                    var exportMenu = ApplicationMenu.FindName("ExportMenu") as RibbonApplicationMenuItem;
                    exportMenu.Items.Add(menuItem);
                    exportMenu.IsEnabled = true;
                    break;
            }
        }
    }

    /// <summary>
    /// Ribbon menu identifiers
    /// </summary>
    public enum RibbonMenu
    {
        ExportList
    }
}